This walkthrough shows you how to enable mail merge with data bound collection in WebTextEditor.
During this walkthrough, you will learn how to do the following:
- Enable mail merge
- Bound access data source to WebTextEditor for mail merge purpose.
Prerequisites
In order to complete this walkthrough, you will need the following:
- Visual Studio 2008 Application.
- Mail server for sending the email
- Northwind_Extended.mdb
Step-By-Step Instructions
To enable mail merge with data bound collection
- Launch Visual Studio.NET 2008.
- Click on File menu, then select New and click Web Site.
- Select ASP.NET Web Site in the Template box and set Location to HTTP.
- Named the Web Site and click OK.
- Right-click on App_Data folder and select Add Existing Item, select Northwind_Extended.mdb from the file explorer.
- Right-click on Project's name and select Add New Item.
- Select WebForm in the My Templates box and named it as Walkthrough.aspx.
- Drag AccessDataSource instance from ToolBar to WebForm.
- Set the access data file to Northwind_Extended.mdb located in App_Data folder and select all columns from the Employees table.
- Drag WebTextEditor instance from ToolBar to WebForm.
- Set the WebTextEditor DataSourceID property to AccessDataSource control.
- Enable the MailMerge feature and add the required label for the mail merge in the Labels collection. The EmailField property will bind Email field from the collection. The SubjectExpression property also accepts MailMerge labels.

- Set the Content property of the WebTextEditor under the RootTextEditor section for the Mail Merge template. For example:
<div><span>Intersoft Solutions</span><br /><span><em>cordially invites you, <span type="mailmerge">{FirstName}</span> <span type="mailmerge">{LastName}</span>, and your family to our</em></span></div>
The <span type="mailmerge">{FirstName}</span> will be substitute by the labels decalred in the MailMerge WebTextEditor section.
- Set EnablePreview to true under the ViewSetting section to enable Mail Merge preview.
- Run the sample in Web Browser. Click the [Preview] command to preview the mail.

Tasks
{Walkthrough: Enabling Mail Merge with Custom Collection}
Other Resources
Mail Merge